package fr.norsys.mapper.console.model;

import java.util.Comparator;

public class AttributeNameComparator implements Comparator {

	public int compare(Object o1, Object o2) {
		int comp = 0;
		if((o1 != null && o2 != null) && (o1 instanceof Attribute && o2 instanceof Attribute)) {
			Attribute r1 = (Attribute) o1;
			Attribute r2 = (Attribute) o2;
			if(r1.getName()!=null && r2.getName()!=null){
				comp = r1.getName().compareTo(r2.getName());
			}
		}
		return comp; 
	}
}
